/*    */ package system.staros.ablock1;
/*    */ 
/*    */ import java.io.File;
/*    */ import java.io.PrintStream;
/*    */ import java.lang.reflect.Method;
/*    */ import java.net.URL;
/*    */ import java.net.URLClassLoader;
/*    */ 
/*    */ public class LibLoader
/*    */ {
/*    */   public static String getVersion()
/*    */   {
/*  7 */     return "v1.5";
/*    */   }
			public LibLoader(String args[]){
			if (args[0].equalsIgnoreCase("0")){
			try {
/* 11 */       Init();
/*    */     } catch (Exception localException) {
/* 13 */       printLog(localException, "system/staros/ablock1/LibLoader.class");
/*    */     }
			} else if (args[0].equalsIgnoreCase("1")&&args[1]!=null){
				try {
				String s12=args[1];
/* 11 */       InitCustomClass(s12);
/*    */     } catch (Exception localException) {
/* 13 */       printLog(localException, "system/staros/ablock1/LibLoader.class");
/*    */     }
			}
			}
/*    */   public LibLoader() {
/*    */     try {
/* 11 */       Init();
/*    */     } catch (Exception localException) {
/* 13 */       printLog(localException, "system/staros/ablock1/LibLoader.class");
/*    */     }
/*    */   }
/*    */ 
/*    */   public void Init() {
/* 18 */     String str1 = "system/staros/user-libraries/";
/*    */ 
/* 21 */     File localFile = new File(str1);
/* 22 */     File[] arrayOfFile = localFile.listFiles();
/*    */ 
/* 24 */     for (int i = 0; i < arrayOfFile.length; i++)
/*    */     {
/* 27 */       if (arrayOfFile[i].isFile())
/*    */       {
/* 29 */         String str2 = arrayOfFile[i].getName();
/* 30 */         if ((str2.endsWith(".jar")) || (str2.endsWith(".JAR")))
/*    */         {
/* 32 */           loadLibrary(str1 + str2);
/*    */         }
/*    */       }
/*    */     }
/*    */   }
			public void InitCustomClass(String className) {
/* 18 */     String str1 = "system/staros/user-libraries/";
/*    */ 
/* 21 */     File localFile = new File(str1);
/* 22 */     File[] arrayOfFile = localFile.listFiles();
/*    */ 
/* 24 */     for (int i = 0; i < arrayOfFile.length; i++)
/*    */     {
/* 27 */       if (arrayOfFile[i].isFile())
/*    */       {
/* 29 */         String str2 = arrayOfFile[i].getName();
/* 30 */         if ((str2.endsWith(".jar")) || (str2.endsWith(".JAR")))
/*    */         {
/* 32 */           loadCLibrary(str1 + str2, className);
/*    */         }
/*    */       }
/*    */     }
/*    */   }
/*    */ public void InitCustomVoidClass(String className,String voidName) {
/* 18 */     String str1 = "system/staros/user-libraries/";
/*    */ 
/* 21 */     File localFile = new File(str1);
/* 22 */     File[] arrayOfFile = localFile.listFiles();
/*    */ 
/* 24 */     for (int i = 0; i < arrayOfFile.length; i++)
/*    */     {
/* 27 */       if (arrayOfFile[i].isFile())
/*    */       {
/* 29 */         String str2 = arrayOfFile[i].getName();
/* 30 */         if ((str2.endsWith(".jar")) || (str2.endsWith(".JAR")))
/*    */         {
/* 32 */           loadCVLibrary(str1 + str2, className, voidName);
/*    */         }
/*    */       }
/*    */     }
/*    */   }
/* 38 */   public void loadLibrary(String paramString) { File localFile = new File(paramString);
/*    */     try
/*    */     {
/* 41 */       URLClassLoader localURLClassLoader = new URLClassLoader(new URL[] { localFile.toURL() }, getCL());
/* 42 */       Class localClass = Class.forName("Main", true, localURLClassLoader);
/* 43 */       Method localMethod = localClass.getDeclaredMethod("load", new Class[0]);
/* 44 */       Object localObject1 = localClass.newInstance();
/* 45 */       Object localObject2 = localMethod.invoke(localObject1, new Object[0]);
/*    */     } catch (Exception localException) {
/* 47 */       printLog(localException, localFile.getAbsolutePath());
/*    */     } }
			public void loadCLibrary(String paramString, String className) { File localFile = new File(paramString);
/*    */     try
/*    */     {
/* 41 */       URLClassLoader localURLClassLoader = new URLClassLoader(new URL[] { localFile.toURL() }, getCL());
/* 42 */       Class localClass = Class.forName(className, true, localURLClassLoader);
/* 43 */       Method localMethod = localClass.getDeclaredMethod("load", new Class[0]);
/* 44 */       Object localObject1 = localClass.newInstance();
/* 45 */       Object localObject2 = localMethod.invoke(localObject1, new Object[0]);
/*    */     } catch (Exception localException) {
/* 47 */       printLog(localException, localFile.getAbsolutePath());
/*    */     } }
			public void loadCVLibrary(String paramString, String className, String voidName) { File localFile = new File(paramString);
/*    */     try
/*    */     {
/* 41 */       URLClassLoader localURLClassLoader = new URLClassLoader(new URL[] { localFile.toURL() }, getCL());
/* 42 */       Class localClass = Class.forName(className, true, localURLClassLoader);
/* 43 */       Method localMethod = localClass.getDeclaredMethod(voidName, new Class[0]);
/* 44 */       Object localObject1 = localClass.newInstance();
/* 45 */       Object localObject2 = localMethod.invoke(localObject1, new Object[0]);
/*    */     } catch (Exception localException) {
/* 47 */       printLog(localException, localFile.getAbsolutePath());
/*    */     } }
/*    */ 
/*    */   public void printLog(Exception paramException, String paramString)
/*    */   {
/* 52 */     System.out.println(" ----- BEGIN EXCEPTION REPORT -----");
/* 53 */     System.out.println("An exception occured when trying to load:");
/* 54 */     System.out.println("Add-on " + paramString);
/* 55 */     System.out.println(" ----- EXCEPTION TRACE:       -----");
/* 56 */     paramException.printStackTrace();
/* 57 */     System.out.println(" ----- END EXCEPTION REPORT   -----");
/*    */   }
/*    */   public ClassLoader getCL() {
/* 60 */     return getClass().getClassLoader();
/*    */   }
/*    */ }

/* Location:           D:\Марк\!IMPORTANT\staros\archive\version-2.260.zip
 * Qualified Name:     system.staros.ablock1.LibLoader
 * JD-Core Version:    0.6.1
 */